package Thread;
//创建线程类
class MyThread extends Thread {
    //继承于标准库中Thread类
    //重写run方法
    public void run() {
        for (int i = 0; i < 5; i++) {
            System.out.println("线程运行");
        }
    }
}
public class dome1{
    public static void main(String[] args) throws InterruptedException {
        MyThread t1 = new MyThread();
        t1.start();
        t1.join();
        System.out.println("主线程运行");
    }
}
